<?php

class Car
{
  private $price = 123;

  # Constructor of car
  public function car()
  {
    //$this->price = 99;
  }

  public function getSpeed()
  {

  }


  public function changeGear()
  {

  }

  public function setPrice()
  {
    $this->price = 20000;
  }

  public function getPrice()
  {
    return $this->price;
  }
}

$maruti800 = new Car;
echo $maruti800->getPrice();

/*
 * Constructor name is same as class name..
 *
 * Constructor will called automatically while creation
 * of object.
 *
 * Constructor don't have return type.
 *
 * WHY WE NEED TO CREATE CONSTRUCTOR
 *
 * Ans : If we have code which seems to be common
 * in most of the methods then it's better of keep that
 * code in common place and that common place
 * is constructor.
 * */
